package com.gw.quotes.net.service;

import org.ksoap2.serialization.SoapObject;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.gw.quotes.entity.business.GetEstimateEntity;
import com.gw.quotes.net.NewException;
import com.gw.quotes.net.Request;
import com.gw.quotes.net.Response;
import com.yxw.util.StringUtils;

/**
 * 评价列表
 * 
 * @author yxw
 *
 */
public class GetCurrTimeImpl extends WebBaseServiceImpl {

	@Override
	public Response setResponse() {
		return new Response();
	}

	@Override
	public void checkParam(Request request) throws NewException {
		if (request == null) {
			throw new NewException(Response.RESULT_ERROR, "传入request不能为空");
		}
	}

	@Override
	public void setParamByRequest(Request request, SoapObject rpc)
			throws NewException {
	}

	@Override
	public String getMethodName() throws NewException {
		return "getCurrTime";
	}

	@Override
	public void resolveResponse(Object object, Response response)
			throws NewException {
		try {
			if (response==null) {
				response=new Response();
			}
			response.setMsg(object.toString());
			response.setResult(Response.RESULT_SUCCESS);
			response.setObj(Long.parseLong(object.toString()));
			if (response != null) {
				setResponse(response);
			} else {
				throw new Exception();
			}
		} catch (Exception e) {
			response.setMsg("获取失败");
			response.setResult(Response.RESULT_ERROR);
		}
	}

}
